home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 September (IDG) / Sep99.iso / Shareware World / Comms & Internet / LinkConverter 1.1.2 / Dialog Director v0.7 / Examples / Progress.as < prev    next >
Encoding:
Text File  |  1998-01-19  |  1.1 KB  |  38 lines  |  [TEXT/ToyS]

  1. OpenProgress("A Progress Example…", 260, "Starting up.")
  2. repeat with n from 1 to 260
  3.     UpdateProgress(n)
  4.     if n = 20 then
  5.         DescribeProgress("Entering first phase.")
  6.     else if n = 60 then
  7.         DescribeProgress("Entering second phase.")
  8.     else if n = 100 then
  9.         DescribeProgress("Main phase.")
  10.     else if n = 200 then
  11.         DescribeProgress("Entering final phase.")
  12.     else if n = 240 then
  13.         DescribeProgress("Finishing off.")
  14.     end if
  15. end repeat
  16. CloseProgress()
  17.  
  18. on OpenProgress(theTitle, theMax, aDescription)
  19.     dd install with grayscale
  20.     dd make dialog {size:[300, 50], style:movable dialog, name:theTitle, contents:[¬
  21.         {class:static text, contents:aDescription, bounds:[8, 4, 290, 20]}, ¬
  22.         {class:gauge, bounds:[10, 25, 290, 25 + 12], value:0, max value:theMax} ¬
  23.             ]}
  24. end OpenProgress
  25.  
  26. on UpdateProgress(aValue)
  27.     dd set value of item 2 of dialog 1 to aValue
  28.     dd interact with user for max ticks 0
  29. end UpdateProgress
  30.  
  31. on DescribeProgress(aDescription)
  32.     dd set contents of item 1 of dialog 1 to aDescription
  33. end DescribeProgress
  34.  
  35. on CloseProgress()
  36.     dd delete dialog 1
  37.     if (dd count dialogs) = 0 then dd uninstall
  38. end CloseProgress